(function (mui, window) {
    var v3DiagnosisRead = window.v3DiagnosisRead = {};
    var baseRequest = window.baseRequest;
    var appConfig = window.appConfig;
    var commonTool = window.commonTool;
    var commonLocale = window.dataManager.getLocale();

    var getDiagnosisDataUrl = appConfig.v3ServiceUrl + '/diagnosis_read/statistic/radio/rx?';
	//add by dongjuanying
	//获取空口占用率数据
	v3DiagnosisRead.getDiagnosisData = function (acSN, callback) {
        baseRequest.commonGet(getDiagnosisDataUrl + mui.param({
                devSN: acSN
            }), 5000, function (code, data) {
            if (code === 2 || code === 1) {
                return callback(2);
            }
            if (code === 0) {
            	if(data == -1 || data.errcode) {
            		callback(1);
	            } else {
	                callback(0, data);
	            }
            }
            
        });
    };
	//end

	//add by zhangfuqiang
	var miniBeiResultUrl = appConfig.v3ServiceUrl + '/diagnosis_read/minibei/result?';
    /**
     * 小小贝页面诊断结果
     * @param {String} userName
     * @param {String} devSN
     * @param {String} shopName
     * @param {Function} callback
     */
    v3DiagnosisRead.getMiniBeiResult = function (userName, devSN, shopName,callback) {
        baseRequest.commonGet(miniBeiResultUrl + $.param({
                apSN: devSN,
                userName: userName,
                sceneName: shopName
            }),
            function (code, data) {
                if (code === 1 || code === 2) {
                    return callback(2);
                }
                if (data == -1 || data.errcode){
                	return callback(1,data.errcode);
				}
				return callback(0,data);
            });
    };
	//end

	//add by ding
	var getDeviceDiagnoseResultUrl = appConfig.v3ServiceUrl + "/diagnosis_read/dev/result?";
	v3DiagnosisRead.getDeviceDiagnoseResult = function(devSN,callback){
		baseRequest.commonGet(getDeviceDiagnoseResultUrl + $.param({
                devSN: devSN
            }),
            function (code, data) {
                if (code === 1 || code === 2) {
                    return callback(2);
                }
                if (data == -1 || data.errcode){
                		return callback(1,data.errcode);
				}
				return callback(0,data);
            });
	}
}(mui, window));